url = "/account/orders.html"
layout="default"
==

{% set orders = catalog.orders %}

<div class="address_content">
		<!-- breadcrumbs -->
		<div class="breadcrumbs">
			<div class="container">
				<ul>
					<li class="fl" ><a href="/">HCLOSET</a></li>

					<li class="fl" >お買物履歴詳細</li>
				</ul>
			</div>
		</div>
		<!-- breadcrumbs end -->

		<div class="orderCont">
			<div class="container">
				<h2 class="pageHead1">お買物履歴詳細</h2>
				<div class="ov dashboardBox">
					<div class="fl d_sidemenus">
						{% partial 'account/left-bar' %}
					</div>
					<div class="fr d_main">
						<div class="main-ttl">お買物履歴詳細</div>
						<div class="detailBox orderBox">
							<div class="detail_date">
								<div class="tab-content" id="orderContent">
									<div class="tab-pane fade in active" id="order-one">
										<div class="table_wrap">
											{% if count(orders) > 0 %}
											<table class="table_type_order">
												<thead>
												<tr>
													<td width="45%">条款</td>
													<td>総計</td>
													<td>注文状况</td>
													<td>操作</td>
												</tr>
												</thead>
												<tbody>
												{% for key, order in orders %}
												{% if order.order_status.code == 'placed' or order.order_status.code == 'pressed' %}
												<tr>
													<th colspan="4"><b>注文NO.：</b>{{ order.sn }}&nbsp;&nbsp;&nbsp;&nbsp;<b>ご注文日付と時間：</b>{{ formatDate("m/d/Y H:i:s", order.created_at) }}</th>
												</tr>
												<tr>
													<td>
														{% for m, orderproduct in order.products %}
														{% set condition = { 'id': orderproduct.product_id } %}
														{% set product = catalog.product(condition) %}
														<div class="orderdiv">
															<a class="table_type_a" href="{{product.url}}" title="{{ orderproduct.name }}" target="_blank">
																<img title="{{ orderproduct.name }}" src="{{ product.getMainThumb(150,150) }}">
															</a>
															<p>
																<a href="{{product.url}}" target="_blank">{{ orderproduct.name }}</a>
															</p>
															<p>
																{{ orderproduct.price|formatPriceNotRate }}
																× {{ orderproduct.qty }}
															</p>
														</div>
														{% endfor %}
													</td>
													<td class="subtotal">
														{{ order.total_price|formatPriceNotRate }}
													</td>
													<td class="total">
														{{ ('jason.ccshop::lang.order.status.' ~ order.order_status.code)|trans }}
													</td>
													<td class="textAlign">
<!-- 														{{ form_open({'request': 'onRePaymentOrder', 'class': 'checkoutForm','id':'yy_onRePaymentOrder_'~order.sn}) }}
														<input type="hidden" name="key" value="{{ order.sn }}">
														<button type="submit" form="yy_onRePaymentOrder_{{order.sn}}">今すぐ支払う</button>
														{{ form_close() }} -->
														<a class="orderXx" href="/repay-{{ order.sn }}-{{ order.payment_method }}-p.html" class="pay_btn">今すぐ支払う</a>
														<a class="orderXx" href="/orderdetail-{{ order.sn }}.html">詳細</a>
														<a class="orderXx bgGray" href="{{ 'account/orders'|page }}"
														   data-request="onCancelOrder"
														   data-request-data="sn: {{ order.sn }}" >キャンセル</a>
													</td>
												</tr>
												{% endif %}
												{% endfor %}
												</tbody>
											</table>
											{% else %}
											<h4 style="text-align:center;margin-top:20px;color:#615757;">ご注文いただいた履歴はございません。</h4>
											{% endif %}
										</div>
									</div>
									<div class="tab-pane fade" id="order-two">
										<div class="table_wrap">
											{% if count(orders) > 0 %}
											<table class="table_type_order">
												<thead>
												<tr>
													<td width="45%">条款</td>
													<td>総計</td>
													<td>注文状况</td>
													<td>操作</td>
												</tr>
												</thead>
												<tbody>
												{% for key, order in orders %}
												{% if order.order_status.code == 'paid' %}
												<tr>
													<th colspan="4"><b>注文NO.：</b>{{ order.sn }}&nbsp;&nbsp;&nbsp;&nbsp;<b>ご注文日付と時間：</b>{{ formatDate("m/d/Y H:i:s", order.created_at) }}</th>
												</tr>
												<tr>
													<td>
														{% for m, orderproduct in order.products %}
														{% set condition = { 'id': orderproduct.product_id } %}
														{% set product = catalog.product(condition) %}
														<div class="orderdiv">
															<a class="table_type_a" href="{{product.url}}" title="{{ orderproduct.name }}" target="_blank">
																<img title="{{ orderproduct.name }}" src="{{ product.getMainThumb(150,150) }}">
															</a>
															<p>
																<a href="{{product.url}}" target="_blank">{{ orderproduct.name }}</a>
															</p>
															<p>
																{{ orderproduct.price|formatPriceNotRate }}
																× {{ orderproduct.qty }}
															</p>
														</div>
														{% endfor %}
													</td>
													<td class="subtotal">
														{{ order.total_price|formatPriceNotRate }}
													</td>
													<td class="total">
														{{ ('jason.ccshop::lang.order.status.' ~ order.order_status.code)|trans }}
													</td>
													<td class="textAlign">
														<a class="orderXx blueBtn1" href="/orderdetail-{{ order.sn }}.html">詳細</a>
													</td>
												</tr>
												{% endif %}
												{% endfor %}
												</tbody>
											</table>
											{% else %}
											<h4 style="text-align:center;margin-top:20px;color:#615757;">ご注文いただいた履歴はございません。</h4>
											{% endif %}
										</div>
									</div>
									<div class="tab-pane fade" id="order-three">
										<div class="table_wrap">
											{% if count(orders) > 0 %}
											<table class="table_type_order">
												<thead>
												<tr>
													<td width="45%">条款</td>
													<td>総計</td>
													<td>注文状况</td>
													<td>操作</td>
												</tr>
												</thead>
												<tbody>
												{% for key, order in orders %}
												{% if order.order_status.code == 'delivered' %}
												<tr>
													<th colspan="4"><b>注文NO.：</b>{{ order.sn }}&nbsp;&nbsp;&nbsp;&nbsp;<b>ご注文日付と時間：</b>{{ formatDate("m/d/Y H:i:s", order.created_at) }}</th>
												</tr>
												<tr>
													<td>
														{% for m, orderproduct in order.products %}
														{% set condition = { 'id': orderproduct.product_id } %}
														{% set product = catalog.product(condition) %}
														<div class="orderdiv">
															<a class="table_type_a" href="{{product.url}}" title="{{ orderproduct.name }}" target="_blank">
																<img title="{{ orderproduct.name }}" src="{{ product.getMainThumb(150,150) }}">
															</a>
															<p>
																<a href="{{product.url}}" target="_blank">{{ orderproduct.name }}</a>
															</p>
															<p>
																{{ orderproduct.price|formatPriceNotRate }}
																× {{ orderproduct.qty }}
															</p>
														</div>
														{% endfor %}
													</td>
													<td class="subtotal">
														{{ order.total_price|formatPriceNotRate }}
													</td>
													<td class="total">
														{{ ('jason.ccshop::lang.order.status.' ~ order.order_status.code)|trans }}
													</td>
													<td class="textAlign blueBtn1">
														<a class="orderXx" href="/orderdetail-{{ order.sn }}.html">詳細</a>
													</td>
												</tr>
												{% endif %}
												{% endfor %}
												</tbody>
											</table>
											{% else %}
											<h4 style="text-align:center;margin-top:20px;color:#615757;">ご注文いただいた履歴はございません。</h4>
											{% endif %}
										</div>
									</div>
									<div class="tab-pane fade" id="order-four">
										<div class="table_wrap">
											{% if count(orders) > 0 %}
											<table class="table_type_order">
												<thead>
												<tr>
													<td width="45%">条款</td>
													<td>総計</td>
													<td>注文状况</td>
													<td>操作</td>
												</tr>
												</thead>
												<tbody>
												{% for key, order in orders %}
												{% if order.order_status.code == 'canceled' or  order.order_status.code == 'refunded'  %}
												<tr>
													<th colspan="4"><b>注文NO.：</b>{{ order.sn }}&nbsp;&nbsp;&nbsp;&nbsp;<b>ご注文日付と時間：</b>{{ formatDate("m/d/Y H:i:s", order.created_at) }}</th>
												</tr>
												<tr>
													<td>
														{% for m, orderproduct in order.products %}
														{% set condition = { 'id': orderproduct.product_id } %}
														{% set product = catalog.product(condition) %}
														<div class="orderdiv">
															<a class="table_type_a" href="{{product.url}}" title="{{ orderproduct.name }}" target="_blank">
																<img title="{{ orderproduct.name }}" src="{{ product.getMainThumb(150,150) }}">
															</a>
															<p>
																<a href="{{product.url}}" target="_blank">{{ orderproduct.name }}</a>
															</p>
															<p>
																{{ orderproduct.price|formatPriceNotRate }}
																× {{ orderproduct.qty }}
															</p>
														</div>
														{% endfor %}
													</td>
													<td class="subtotal">
														{{ order.total_price|formatPriceNotRate }}
													</td>
													<td class="total">
														{{ ('jason.ccshop::lang.order.status.' ~ order.order_status.code)|trans }}
													</td>
													<td class="textAlign blueBtn1">
														<a class="orderXx" href="/orderdetail-{{ order.sn }}.html">詳細</a>
													</td>
												</tr>
												{% endif %}
												{% endfor %}
												</tbody>
											</table>
											{% else %}
											<h4 style="text-align:center;margin-top:20px;color:#615757;">ご注文いただいた履歴はございません。</h4>
											{% endif %}
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>

	</div>